package com.huluspace.learnhub.controller;

import com.huluspace.learnhub.dto.RoleDTO;
import com.huluspace.learnhub.service.RoleService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/api/role")
public class RoleController {

  private final RoleService roleService;
  public RoleController(RoleService roleService) {
    this.roleService = roleService;
  }

  // 获取可选角色（用于注册等前端用途）
  @GetMapping("/available")
  public List<RoleDTO> getAvailableRoles() {
    return roleService.getAvailableRoles();
  }


}

